import  time
import datetime
#通过datetime模块完成时间戳、datetime对象、格式化字符串三者之间的转换
now = print(time.time())
1609869221.6649473

now = datetime.datetime.now(tz=None)
now
datetime.datetime(2021, 1, 6, 1, 45, 53, 767724)

print(now.strftime("%Y-%m-%d %H:%M:%S"))
2021-01-06 01:45:53

now.timestamp()
1609868753.767724